export class PwdData {
        /**连接状态 */
      mStatus = EPwdStatus.CHECK_FAIL;//EPwdStatus
      pwd="0000";//String
      /**设备编号 */
      deviceNumber=0;//int
      /**设备版本 */
      deviceVersion="";//String
      /**设备测试版本 */
      deviceTestVersion="";
      /**是否饮酒 */
      isHaveDrinkData=false;
      /**抬头亮表 */
      isOpenNightTurnWriste=EFunctionStatus.UNKONW;
      /**防丢失 */
      findPhoneFunction=EFunctionStatus.UNKONW;
      /**穿戴检测 */
      wearDetectFunction=EFunctionStatus.UNKONW;

      toString() {
        return "PwdData{mStatus=" + this.matchStatus(this.mStatus) + 
        ", 设备编号=" + this.deviceNumber + ", 设备版本='" + this.deviceVersion + '\'' + ", 设备测试版本='" + this.deviceTestVersion + '\'' + ", 是否有饮酒数据=" + this.isHaveDrinkData + 
        ", 抬手亮屏=" + this.matchEFunctionStatus(this.isOpenNightTurnWriste) + 
        ", \n设置防丢=" + this.matchEFunctionStatus(this.findPhoneFunction) +
         ",佩戴检测=" + this.matchEFunctionStatus(this.wearDetectFunction)+ '}';
    }

    matchStatus(value) {
        for (const key in EPwdStatus) {
            if (EPwdStatus[key] === value) {
                return key;
            }
        }
        return null;
    }

    matchEFunctionStatus(value) {
        for (const key in EFunctionStatus) {
            if (EFunctionStatus[key] === value) {
                return key;
            }
        }
        return null;
    }
 }

 export const EPwdStatus = {
    CHECK_FAIL:0,
    CHECK_SUCCESS:1,
    SETTING_FAIL:2,
    SETTING_SUCCESS:3,
    READ_FAIL:4,
    READ_SUCCESS:5,
    CHECK_AND_TIME_SUCCESS:6,
    UNKNOW:7
}


/**
 * 功能支持
 */
export const EFunctionStatus = {
    UNSUPPORT:0,
    SUPPORT:1,
    SUPPORT_OPEN:2,
    SUPPORT_CLOSE:3,
    UNKONW:4
}